#@layout()

#define script()
<script>
    $.ajax({
        url: "http://47.105.208.60:8080/wechat-api/article/selectsum?categoryId=92"
        //url: "http://localhost:8080/wechat-api/article/selectsum?categoryId=92"
        , dataType: 'json'
        , type: 'get'
        , success: function (data) {

            if (data.code == 0) {
                $("h5").html("");
                var infos = data.info;
                $(infos).each(function () {

                    var content = "<tr id='tr' class='tr'>"+
                        "<td>" + this.sum + "</td>"+
                        "<td>" + this.id + "</td>"+
                        "<td>" + this.title + "</td>"+
                        "<td>" + this.nickname + "</td>"+
                        "<td><button onclick='del(\"" + this.id + "\")'>退出巡展</button></td>"+
                        "</tr>";
                    $("h5").append($(content));
                })
            } else {
                alert("操作失败");//请求传输失败回调函数
            }
        }
        , error: function (msg) {
            console.log("----------")
            alert(msg); //错误信息

        }

    })
    function del(id) {
        $.ajax({
            url: "http://47.105.208.60:8080/wechat-api/mapping/delshow?articleId=" + id
            //url: "http://localhost:8080/wechat-api/mapping/delshow?articleId=" + id
            , dataType: 'json'
            , type: 'get'
            , success: function (data) {

                if (data.code == 0) {
                    alert("操作成功");
                    window.location.reload();
                } else {
                    alert("操作失败");
                }
            }
            , error: function (msg) {
                console.log("----------")
                alert(msg); //错误信息

            }

        })
    }
</script>

#end

#define content()
<div class="content-wrapper">
    <section class="content-header">
        <h1>
            作品巡展
        </h1>
    </section>

    <section class="content-header text-tap">
    </section>
    <div>
        <div class="box box-primary">
            <div class="box-body ">

                <table class="table table-striped">
                    <thead>
                    <tr>
                        <th>点赞数量</th>
                        <th>参赛编号</th>
                        <th>作品名称</th>
                        <th>作者</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>


                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
#end
